package bidsanity

class HomeController {

    def index() {
        if (params["sort"] == null || params["sort"] == "")
        {
            params["sort"] = "startDate"
            params["order"] = "desc"
        }

        params.max = Math.min(params.max ? params.int('max') : 5, 100)

        [listingInstanceList: Listing.findAllByEndDateGreaterThanEquals(new Date(), params), listingInstanceTotal: Listing.findAllByEndDateGreaterThanEquals(new Date()).size()]
    }
}
